/*
 *
 * Copyright (C) 2014
 * Julio Jarquin, Gustavo Arechavaleta <garechav@cinvestav.edu.mx>
 * CINVESTAV - Saltillo Campus
 *
 * This file is part of HRLocomotion-1.0
 * HRLocomotion-1.0 free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * HRLocomotion-1.0 is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301  USA
 */

/**
 *	\file src/hr_types.h
 *	\author Julio Jarquin, Gustavo Arechavaleta
 *	\version 1.0
 *	\date 2015
 *
 *	Declaration of the HRLocomotion types.
 */

#ifndef HR_LOCOMOTION_TYPES_H
#define HR_LOCOMOTION_TYPES_H
#include "Eigen/Dense"

/** qpOASES namespace forward declaration. Not need to include qpoases */
namespace qpOASES{
#ifdef  __USE_SINGLE_PRECISION__
            //using real_t = float;  //c++11
/** Defines real_t TYPE as float. */
            typedef float real_t;
#else
/** Defines real_t TYPE as double. */
            typedef double real_t;
#endif

}

/** hrLocomotion namespace, namespace used by the project */
namespace hrLocomotion{

/** Defines SUCCESS_INIT as a true bool type, used for return in many methods. */
    const bool SUCCESS_INIT = true;
/** Defines FAILED_INIT as a false bool type, used for return in many methods. */
    const bool FAILED_INIT = false;

    /** Defines real_t TYPE for facilitating switching between double and float. */
#ifdef  __USE_SINGLE_PRECISION__
            //using real_t = float;  //c++11
    /** Defines real_t TYPE as float. */
    typedef float real_t;
#else
    /** Defines real_t TYPE as double. */
    typedef double real_t;
#endif

    /**
     *	\brief Defines a new eigen-based matrix type that will be used by the QPProblem.
     *
     *	Defines a real_t row major matrix.
     */
    typedef  Eigen::Matrix<real_t,Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> MatrixXr;

    /**
     *	\brief Defines a new eigen-based vector type that will be used by the QPProblem.
     *
     *	Defines a real_t vector.
     */
    typedef  Eigen::Matrix<real_t,Eigen::Dynamic, 1> VectorXr;

    /**
     *	\brief Defines a new eigen-based vector type that will be used by the RobotState class.
     *
     *	Defines a real_t vector of size 9x1.
     */

    typedef Eigen::Matrix<real_t , 9 , 1> Vector9r;

    /**
     *	\brief Defines a new eigen-based vector type that will be used by the RobotState class.
     *
     *	Defines a real_t vector of size 3x1.
     */
    typedef Eigen::Matrix<real_t , 3 , 1> Vector3r;


    /**
     *	\brief Defines a new eigen-based vector type that will be used by the RobotState class.
     *
     *	Defines a real_t vector of size 2x1.
     */
    typedef Eigen::Matrix<real_t , 2 , 1> Vector2r;


    using std::sqrt;
    using std::pow;


    enum FootStatus{
        kLeftFootOnGround,
        kRightFootOnGround,
        kBoothFeetOnGround
    };

    enum RobotStatus{
        kStop,
        kStopped,
        kPaused,
        kWalking,
        kError
    };


}






#endif // HR_LOCOMOTION_TYPES_H
